﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?application progid="SMath Studio Desktop" version="0.99.6622.8829"?>
<regions xmlns="http://smath.info/schemas/worksheet/1.0">
  <settings dpi="96">
    <identity>
      <id>f08257c1-c149-4c08-a33f-3ce92c85a6d4</id>
      <revision>23</revision>
    </identity>
    <calculation>
      <precision>7</precision>
      <exponentialThreshold>7</exponentialThreshold>
      <fractions>decimal</fractions>
    </calculation>
    <pageModel active="true" viewMode="0" printGrid="false" printAreas="true" simpleEqualsOnly="false" printBackgroundImages="true">
      <paper id="1" orientation="Portrait" width="850" height="1100" />
      <margins left="39" right="39" top="39" bottom="39" />
      <header alignment="Center" color="#a9a9a9">&amp;[DATE] &amp;[TIME] - &amp;[FILENAME]</header>
      <footer alignment="Center" color="#a9a9a9">&amp;[PAGENUM] / &amp;[COUNT]</footer>
      <backgrounds />
    </pageModel>
    <dependencies>
      <assembly name="SMath Studio Desktop" version="0.99.6622.8829" guid="a37cba83-b69c-4c71-9992-55ff666763bd" />
      <assembly name="Math Region" version="0.99.6622.8829" guid="02f1ab51-215b-466e-a74d-5d8b1cf85e8d" />
      <assembly name="Special Functions" version="1.11.6622.8831" guid="2814e667-4e12-48b1-8d51-194e480eabc5" />
      <assembly name="Text Region" version="1.10.6622.8831" guid="485d28c5-349a-48b6-93be-12a35a1c1e39" />
      <assembly name="Statistical Tools" version="1.0.6599.21762" guid="76f6e9f5-ac86-4ffb-9e4d-284c8daecaf9" />
    </dependencies>
    <mode debug="true" />
  </settings>
  <region id="0" left="9" top="9" width="198" height="99" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4" trailingZeros="true">
      <input>
        <e type="operand">W</e>
        <e type="operand">1.22</e>
        <e type="operand">7.36</e>
        <e type="operand">7.96</e>
        <e type="operand">7.94</e>
        <e type="operand">1.26</e>
        <e type="operand">2.36</e>
        <e type="operand">4.74</e>
        <e type="operand">3.07</e>
        <e type="operand">5.83</e>
        <e type="operand">4.11</e>
        <e type="operand">3.78</e>
        <e type="operand">8.14</e>
        <e type="operand">3.64</e>
        <e type="operand">9.93</e>
        <e type="operand">8.95</e>
        <e type="operand">9.73</e>
        <e type="operand">5.13</e>
        <e type="operand">3.71</e>
        <e type="operand">5.78</e>
        <e type="operand">3.16</e>
        <e type="operand">5</e>
        <e type="operand">4</e>
        <e type="function" args="22">mat</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="1" left="252" top="9" width="186" height="31" color="#000000" bgColor="#80ffff" fontSize="14">
    <text lang="eng">
      <p bold="true">The truth table</p>
    </text>
  </region>
  <region id="2" left="252" top="54" width="179" height="56" color="#000000" bgColor="#ffff80" fontSize="10">
    <math decimalPlaces="3" trailingZeros="true">
      <description active="true" position="Right" lang="eng">
        <p>search range value"truth" condition</p>
      </description>
      <input>
        <e type="operand">lo</e>
        <e type="operand">2</e>
        <e type="operator" args="2">:</e>
        <e type="operand">hi</e>
        <e type="operand">4</e>
        <e type="operator" args="2">:</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" args="4">mat</e>
        <e type="operand">x</e>
        <e type="function" args="1">c</e>
        <e type="operand">x</e>
        <e type="operand">lo</e>
        <e type="operator" args="2">≥</e>
        <e type="bracket">(</e>
        <e type="operand">x</e>
        <e type="operand">hi</e>
        <e type="operator" args="2">≤</e>
        <e type="bracket">(</e>
        <e type="operator" args="2">*</e>
        <e type="function" args="1">vectorize</e>
        <e type="operator" args="2">:</e>
        <e type="operand">2</e>
        <e type="operand">1</e>
        <e type="function" args="4">sys</e>
      </input>
    </math>
  </region>
  <region id="3" left="9" top="117" width="407" height="329" border="true" color="#000000" bgColor="#ffffe1" fontSize="10">
    <math decimalPlaces="3" trailingZeros="true">
      <description active="true" position="Top" lang="eng">
        <p>Nested exploder sorted row wise ... [row_col]</p>
      </description>
      <input>
        <e type="operand">M</e>
        <e type="operand">lo</e>
        <e type="operand">hi</e>
        <e type="function" args="3">locate</e>
        <e type="operand">k</e>
        <e type="operand">0</e>
        <e type="operator" args="2">:</e>
        <e type="operand">i</e>
        <e type="operand">1</e>
        <e type="operand">M</e>
        <e type="function" args="1">rows</e>
        <e type="function" args="2">range</e>
        <e type="operand">j</e>
        <e type="operand">1</e>
        <e type="operand">M</e>
        <e type="function" args="1">cols</e>
        <e type="function" args="2">range</e>
        <e type="operand">M</e>
        <e type="operand">i</e>
        <e type="operand">j</e>
        <e type="function" args="3">el</e>
        <e type="operand">lo</e>
        <e type="operator" args="2">≥</e>
        <e type="bracket">(</e>
        <e type="operand">M</e>
        <e type="operand">i</e>
        <e type="operand">j</e>
        <e type="function" args="3">el</e>
        <e type="operand">hi</e>
        <e type="operator" args="2">≤</e>
        <e type="bracket">(</e>
        <e type="operator" args="2">*</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≠</e>
        <e type="operand">u</e>
        <e type="operand">k</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="function" args="2">el</e>
        <e type="operand">i</e>
        <e type="operator" args="2">:</e>
        <e type="operand">v</e>
        <e type="operand">k</e>
        <e type="operand">k</e>
        <e type="operator" args="2">:</e>
        <e type="function" args="2">el</e>
        <e type="operand">j</e>
        <e type="operator" args="2">:</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" args="4">mat</e>
        <e type="operand">k</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="function" args="3">if</e>
        <e type="function" args="3">for</e>
        <e type="function" args="3">for</e>
        <e type="operand" style="string">strip paired 0's</e>
        <e type="operand">k</e>
        <e type="operand">0</e>
        <e type="operator" args="2">:</e>
        <e type="operand">i</e>
        <e type="operand">1</e>
        <e type="operand">u</e>
        <e type="function" args="1">rows</e>
        <e type="function" args="2">range</e>
        <e type="operand">u</e>
        <e type="operand">i</e>
        <e type="function" args="2">el</e>
        <e type="operand">v</e>
        <e type="operand">i</e>
        <e type="function" args="2">el</e>
        <e type="operator" args="2">*</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≠</e>
        <e type="operand">R</e>
        <e type="operand">k</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="function" args="2">el</e>
        <e type="operand">u</e>
        <e type="operand">i</e>
        <e type="function" args="2">el</e>
        <e type="operand">v</e>
        <e type="operand">i</e>
        <e type="function" args="2">el</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" args="4">mat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">1</e>
        <e type="operand">1</e>
        <e type="function" args="3">line</e>
        <e type="operand" style="string">NOT in search lo/hi</e>
        <e type="function" args="3">if</e>
        <e type="operand">1</e>
        <e type="operand">1</e>
        <e type="function" args="3">line</e>
        <e type="function" args="3">for</e>
        <e type="operand">R</e>
        <e type="operand">3</e>
        <e type="operand">1</e>
        <e type="function" args="5">line</e>
        <e type="operand">4</e>
        <e type="operand">1</e>
        <e type="function" args="6">line</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="4" left="423" top="144" width="313" height="99" color="#000000" bgColor="#e1ffff" fontSize="10">
    <math decimalPlaces="4" trailingZeros="true">
      <description active="true" position="Top" lang="eng">
        <p>Truth table</p>
      </description>
      <input>
        <e type="operand">W</e>
        <e type="function" args="1">c</e>
        <e type="operand">W</e>
        <e type="operator" args="2">*</e>
        <e type="function" args="1">vectorize</e>
      </input>
      <result action="numeric">
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">2.3600</e>
        <e type="operand">0.0000</e>
        <e type="operand">3.0700</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">3.7800</e>
        <e type="operand">0.0000</e>
        <e type="operand">3.6400</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">0.0000</e>
        <e type="operand">3.7100</e>
        <e type="operand">0.0000</e>
        <e type="operand">3.1600</e>
        <e type="operand">5</e>
        <e type="operand">4</e>
        <e type="function" args="22">mat</e>
      </result>
    </math>
  </region>
  <region id="5" left="9" top="459" width="279" height="243" border="true" color="#000000" bgColor="#ebebeb" fontSize="10">
    <math decimalPlaces="3" trailingZeros="true">
      <description active="true" position="Top" lang="eng">
        <p>Vectorized Bolean sorted cols wise.</p>
      </description>
      <input>
        <e type="operand">M</e>
        <e type="operand">c</e>
        <e type="function" args="2">Mc</e>
        <e type="operand">U</e>
        <e type="operand">M</e>
        <e type="function" args="1">c</e>
        <e type="operand">M</e>
        <e type="operator" args="2">*</e>
        <e type="function" args="1">vectorize</e>
        <e type="operator" args="2">:</e>
        <e type="operand">V</e>
        <e type="operand">U</e>
        <e type="operand">1</e>
        <e type="function" args="2">col</e>
        <e type="operator" args="2">:</e>
        <e type="operand">i</e>
        <e type="operand">2</e>
        <e type="operand">U</e>
        <e type="function" args="1">cols</e>
        <e type="function" args="2">range</e>
        <e type="operand">V</e>
        <e type="operand">V</e>
        <e type="operand">U</e>
        <e type="operand">i</e>
        <e type="function" args="2">col</e>
        <e type="function" args="2">stack</e>
        <e type="operator" args="2">:</e>
        <e type="function" args="3">for</e>
        <e type="operand">k</e>
        <e type="operand">0</e>
        <e type="operator" args="2">:</e>
        <e type="operand">i</e>
        <e type="operand">1</e>
        <e type="operand">V</e>
        <e type="function" args="1">rows</e>
        <e type="function" args="2">range</e>
        <e type="operand">V</e>
        <e type="operand">i</e>
        <e type="function" args="2">el</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≠</e>
        <e type="operand">R</e>
        <e type="operand">k</e>
        <e type="operand">k</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="function" args="2">el</e>
        <e type="operand">V</e>
        <e type="operand">i</e>
        <e type="function" args="2">el</e>
        <e type="operator" args="2">:</e>
        <e type="operand">1</e>
        <e type="operand">1</e>
        <e type="function" args="3">line</e>
        <e type="operand" style="string">NOT &lt;lo/hi&gt;</e>
        <e type="function" args="3">if</e>
        <e type="operand">1</e>
        <e type="operand">1</e>
        <e type="function" args="3">line</e>
        <e type="function" args="3">for</e>
        <e type="operand">R</e>
        <e type="operand">6</e>
        <e type="operand">1</e>
        <e type="function" args="8">line</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="6" left="18" top="774" width="517" height="345" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">M</e>
        <e type="operand">c</e>
        <e type="function" args="2">find</e>
        <e type="operand">rm</e>
        <e type="operand">M</e>
        <e type="function" args="1">rows</e>
        <e type="operator" args="2">:</e>
        <e type="operand">cm</e>
        <e type="operand">M</e>
        <e type="function" args="1">cols</e>
        <e type="operator" args="2">:</e>
        <e type="operand">lm</e>
        <e type="operand">cm</e>
        <e type="operand">rm</e>
        <e type="operator" args="2">*</e>
        <e type="operator" args="2">:</e>
        <e type="operand">vM</e>
        <e type="operand">c</e>
        <e type="operand">M</e>
        <e type="operator" args="2">*</e>
        <e type="function" args="1">vectorize</e>
        <e type="operator" args="2">:</e>
        <e type="operand">nzvM</e>
        <e type="operand">c</e>
        <e type="bracket">(</e>
        <e type="function" args="1">sum</e>
        <e type="operator" args="2">:</e>
        <e type="operand">Index</e>
        <e type="operand">nzvM</e>
        <e type="operand">1</e>
        <e type="function" args="2">matrix</e>
        <e type="operator" args="2">:</e>
        <e type="operand">V</e>
        <e type="operand">nzvM</e>
        <e type="operand">1</e>
        <e type="function" args="2">matrix</e>
        <e type="operator" args="2">:</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" args="4">mat</e>
        <e type="operand">jj</e>
        <e type="operand">1</e>
        <e type="operator" args="2">:</e>
        <e type="operand">ii</e>
        <e type="operand">1</e>
        <e type="operand">lm</e>
        <e type="function" args="2">range</e>
        <e type="operand">vM</e>
        <e type="operand">ii</e>
        <e type="function" args="2">el</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≠</e>
        <e type="operand">Index</e>
        <e type="operand">jj</e>
        <e type="function" args="2">el</e>
        <e type="operand">ii</e>
        <e type="operand">cm</e>
        <e type="operator" args="2">/</e>
        <e type="function" args="1">Ceil</e>
        <e type="operand">1</e>
        <e type="operand">ii</e>
        <e type="operand">1</e>
        <e type="operator" args="2">-</e>
        <e type="operand">cm</e>
        <e type="function" args="2">mod</e>
        <e type="operator" args="2">+</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" args="4">mat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">V</e>
        <e type="operand">jj</e>
        <e type="function" args="2">el</e>
        <e type="operand">M</e>
        <e type="operand">ii</e>
        <e type="function" args="2">el</e>
        <e type="operator" args="2">:</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" args="4">mat</e>
        <e type="operand">jj</e>
        <e type="operand">jj</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
        <e type="operand">2</e>
        <e type="operand">1</e>
        <e type="function" args="4">line</e>
        <e type="operand">0</e>
        <e type="function" args="3">if</e>
        <e type="operand">1</e>
        <e type="operand">1</e>
        <e type="function" args="3">line</e>
        <e type="function" args="3">for</e>
        <e type="operand">Index</e>
        <e type="operand">V</e>
        <e type="operand">2</e>
        <e type="operand">1</e>
        <e type="function" args="4">mat</e>
        <e type="operand">9</e>
        <e type="operand">1</e>
        <e type="function" args="11">line</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="7" left="36" top="1386" width="214" height="30" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">W</e>
        <e type="operand">100</e>
        <e type="operand">100</e>
        <e type="operand">1</e>
        <e type="operand">10</e>
        <e type="function" args="4">Random.N</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="8" left="36" top="1431" width="245" height="34" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">t</e>
        <e type="operand">0</e>
        <e type="function" args="1">time</e>
        <e type="operator" args="2">:</e>
      </input>
      <result action="numeric">
        <e type="operand">1.3163698</e>
        <e type="operand">10</e>
        <e type="operand">10</e>
        <e type="operator" args="2">^</e>
        <e type="operator" args="2">*</e>
        <e type="operand" style="unit">s</e>
        <e type="operator" args="2">*</e>
      </result>
    </math>
  </region>
  <region id="9" left="54" top="1485" width="203" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="3" trailingZeros="true">
      <input>
        <e type="operand">index</e>
        <e type="operand">W</e>
        <e type="operand">lo</e>
        <e type="operand">hi</e>
        <e type="function" args="3">locate</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="10" left="63" top="1530" width="149" height="28" color="#000000" bgColor="#ffffff" fontSize="10">
    <math optimize="2" decimalPlaces="3" trailingZeros="true">
      <input>
        <e type="operand">values</e>
        <e type="operand">W</e>
        <e type="operand">c</e>
        <e type="function" args="2">Mc</e>
        <e type="bracket">(</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="11" left="36" top="1575" width="127" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>execution time</p>
    </text>
  </region>
  <region id="12" left="54" top="1620" width="207" height="26" color="#000000" bgColor="#00ff00" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">0</e>
        <e type="function" args="1">time</e>
        <e type="operand">t</e>
        <e type="operator" args="2">-</e>
      </input>
      <result action="numeric">
        <e type="operand">29.0979996</e>
        <e type="operand" style="unit">s</e>
        <e type="operator" args="2">*</e>
      </result>
    </math>
  </region>
  <region id="13" left="36" top="1701" width="91" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">t</e>
        <e type="operand">0</e>
        <e type="function" args="1">time</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="14" left="27" top="1773" width="210" height="45" color="#000000" bgColor="#ffffff" fontSize="10">
    <math optimize="2" trailingZeros="true">
      <input>
        <e type="operand">index2</e>
        <e type="operand">values2</e>
        <e type="operand">2</e>
        <e type="operand">1</e>
        <e type="function" args="4">mat</e>
        <e type="operand">W</e>
        <e type="operand">W</e>
        <e type="function" args="1">c</e>
        <e type="function" args="2">find</e>
        <e type="bracket">(</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="15" left="45" top="1854" width="199" height="26" color="#000000" bgColor="#00ff00" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">0</e>
        <e type="function" args="1">time</e>
        <e type="operand">t</e>
        <e type="operator" args="2">-</e>
      </input>
      <result action="numeric">
        <e type="operand">4.9419995</e>
        <e type="operand" style="unit">s</e>
        <e type="operator" args="2">*</e>
      </result>
    </math>
  </region>
  <region id="16" left="36" top="1908" width="258" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>Check they produce same result</p>
    </text>
  </region>
  <region id="17" left="126" top="1962" width="245" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">values</e>
        <e type="function" args="1">length</e>
      </input>
      <result action="numeric">
        <e type="operand">3025.0000000</e>
      </result>
    </math>
  </region>
  <region id="18" left="117" top="2007" width="253" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">values2</e>
        <e type="function" args="1">length</e>
      </input>
      <result action="numeric">
        <e type="operand">3025.0000000</e>
      </result>
    </math>
  </region>
  <region id="19" left="117" top="2061" width="322" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">values</e>
        <e type="function" args="1">sort</e>
        <e type="operand">values2</e>
        <e type="function" args="1">sort</e>
        <e type="operator" args="2">≡</e>
      </input>
      <result action="numeric">
        <e type="operand">1.0000000</e>
      </result>
    </math>
  </region>
  <region id="20" left="486" top="2061" width="216" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math trailingZeros="true">
      <input>
        <e type="operand">index</e>
        <e type="operand">index2</e>
        <e type="operator" args="2">≡</e>
      </input>
      <result action="numeric">
        <e type="operand">1.0000000</e>
      </result>
    </math>
  </region>
</regions>